13. Sending Tokens
Sending Tokens with Requests
Accessing Authorization Headers in Flask
ND004 C03 L02 A11.1 Sending Tokens 1
Validating Auth Header Formats and Defining our Decorator
NOTE : This step does not validate if a JWT is authentic and has not been tampered with. We'll cover those checks in Practice - Applying Skills in Flask .
ND004 C03 L02 A11.2 Sending Tokens 1
Formatting a Bearer Token String
QUESTION:
Enter the following JWT as the payload of a Bearer Authorization Header:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiZ2FiZSIsInNjaG9vbCI6InVkYWNpdHkiLCJyb2xlIjoiaW5zdHJ1Y3RvciJ9.T9hKh61bM-lFqvntAWrqPLWxAH-Ig0usQVwiVcJ1g5g
SOLUTION:
NOTE: The solutions are expressed in RegEx pattern. Udacity uses these patterns to check the given answer
Sending Tokens from Popular Frontend Frameworks
- React + Redux - JWT Tutorial There are many ways to include JWTs in requests from frontend frameworks. Jason Watmore has many tutorials for your frontend flavor of choice.
- Angular Interceptors for Authorization Headers
Additional Reading
- MDN Web Docs Authorization Header Documentation.
- Postman Authorization Including authorization headers in postman requests.